import  requests

def get_header():
    url = 'http://ihrm-test.itheima.net/api/sys/login'
    data = {"mobile":"13800000002","password":"123456"}

    resp = requests.post(url=url,json=data)
    print(resp.json())
    #从响应体中获取data的值
    token =resp.json().get("data")
    header = {'Content_type': 'application/json',
              'Authorization':"Bearer " + token}
    print("header=",header)

if __name__ == '__main__':
    get_header()